Skip to main content

Method 2: Ansatz

In the previous section, we derived the differential equation that describes the motion of a mass-spring system. This differential equation is a second-order ordinary differential equation (ODE) that can be written as:

In this section, we will explore the second method to solve this differential equation, which uses the ansatz method.

Table of Contents

The Ansatz Method

"Ansatz" is a German word that means "approach" or "attempt". In mathematics, the ansatz method is a method of solving differential equations by guessing a solution and then verifying that it satisfies the differential equation.

The ansatz method is particularly useful for solving linear differential equations, such as the one we have here.

In order to make an educated guess for the solution of the differential equation, we can use both the form of the differential equation and our knowledge of the system:

  • In a spring-mass system, or any other system that exhibits simple harmonic motion, we know that the system oscillates back and forth around the equilibrium position.
  • We also know that the second derivative of the position with respect to time is proportional to the position itself, with a negative sign.

Based on this knowledge, we can guess that the solution to the differential equation can take two forms:

  1. A sinusoidal function of time, such as or .
  2. An exponential function of time, such as .
Sines and Exponentials are the Same

It's not a coincidence that both of these functions are solutions to the differential equation. In fact, they fundamentally describe the same motion, just in different ways, which deserves a deeper discussion.

Consider the function . Its derivative is , meaning that the derivative is proportional to the function itself. If we think of the function as a position and the derivative as a velocity, this means that the velocity is proportional to the position. As the position increases, the velocity increases, and it grows exponentially.

Now if we put an imaginary term in the exponent, we get . Recall that fundamentally represents a rotation in the complex plane. Its derivative is , which is times the function itself. This means that the velocity is not only proportional to the position, but it is also rotated by . Hence, the velocity is perpendicular to the position - i.e. circular motion.

Now recall that the trigonometric functions and are just the coordinates of a point on the unit circle. It should be clear that the exponential function describes the same motion as the trigonometric functions, just in a different way. This is quantatively described via Euler's formula, which states that .

We will try both of these forms and see that they are indeed solutions to the differential equation. Before that, we need to remind ourselves of the initial conditions of the system:

  • The position of the object at is .
  • The velocity of the object at is .

Trying the Sinusoidal Function

Let's first try the sinusoidal function . We can differentiate this function twice to get the acceleration and then substitute it into the differential equation to see if it holds.

The acceleration is given by:

So this indeed holds true for the differential equation.

We can also try the cosine function and see that it also satisfies the differential equation:

This corresponds to the fact that the sine and cosine functions both describe the same motion, just with different phase offsets.

Trying the Exponential Function

Now let's try the exponential function .

The acceleration is given by:

Now we can substitute this into the differential equation:

Hence , which means that .

Plugging this back into the exponential function, we get:

Since this is complex-valued, we can take the real part of this function to get a real-valued solution:

General Solution

From the above analysis, we see that the general solution is either a sine function or a cosine function:

Which one is correct? It turns out, both are correct, but the general solution is more than just one of these functions.

Consider two solutions and to the differential equation. Then the sum of these two solutions is also a solution:

Similarly, multiplying a solution by a constant also gives a solution:

This means that if we have the sine and cosine solutions, we can freely add and multiply them to get another solution. This is known as a linear combination of the solutions:

This is the most general solution to the differential equation; any other solution can be written in this form.